package com.simple.datax.db.mybatis.model;

import java.io.Serializable;

import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 
 * @author paladin
 *
 */
public class DataxEnterpriseChannelKey implements Serializable {	
	
	public DataxEnterpriseChannelKey() {		
	}
	
    public DataxEnterpriseChannelKey(String entCode, String serviceCode) {
		super();
		this.entCode = entCode;
		this.serviceCode = serviceCode;
	}

	private String entCode;

    private String serviceCode;

    private static final long serialVersionUID = 1L;

    public String getEntCode() {
        return entCode;
    }

    public void setEntCode(String entCode) {
        this.entCode = entCode == null ? null : entCode.trim();
    }

    public String getServiceCode() {
        return serviceCode;
    }

    public void setServiceCode(String serviceCode) {
        this.serviceCode = serviceCode == null ? null : serviceCode.trim();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        DataxEnterpriseChannelKey other = (DataxEnterpriseChannelKey) that;
        return (this.getEntCode() == null ? other.getEntCode() == null : this.getEntCode().equals(other.getEntCode()))
            && (this.getServiceCode() == null ? other.getServiceCode() == null : this.getServiceCode().equals(other.getServiceCode()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getEntCode() == null) ? 0 : getEntCode().hashCode());
        result = prime * result + ((getServiceCode() == null) ? 0 : getServiceCode().hashCode());
        return result;
    }
    
    public String toString() {
		return ReflectionToStringBuilder.toString(this,
				ToStringStyle.SHORT_PREFIX_STYLE);
	}
}